#include <stdio.h>
// 判断素数的函数，素数是大于1且仅能被1和自身整除的自然数
int isPrime(int n)
{
  if (n <= 1)
    return 0;
  for (int i = 2; i * i <= n; i++)
  {
    if (n % i == 0)
      return 0;
  }
  return 1;
}

int main()
{
  int num;
  printf("Enter a number: ");
  scanf("%d", &num);
  if (isPrime(num))
    printf("%d is a prime number.\n", num);
  else
    printf("%d is not a prime number.\n", num);
  return 0;
}